package net.zui.test.comp;

import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

import javax.swing.JOptionPane;

import net.zui.annotation.Action;
import net.zui.enume.ActionEnum;
import net.zui.util.UComm;

public class MainAction1 {
	public MainFrame frame;

	public MainAction1( MainFrame frame) {
		this.frame=frame;
	}
	
	@Action(id="ZButton1",action=ActionEnum.mouseClicked)
	public void but1Click(MouseEvent e) {
		System.out.println(e);
		JOptionPane.showMessageDialog(frame, "JackJiang牛批！", "彩虹屁", JOptionPane.WARNING_MESSAGE);
	}
	
	@Action(id="ZButton2",action=ActionEnum.mouseClicked)
	public void but2Click(MouseEvent e) {
		System.out.println(e);
		JOptionPane.showMessageDialog(frame, "JackJiang牛批！", "彩虹屁", JOptionPane.WARNING_MESSAGE);
	}
	
	@Action(id="this",action=ActionEnum.keyTyped)
	public void frameKeyTyped(KeyEvent e) {
		UComm.info(this.getClass(), "[keyTyped] char:",e.getKeyCode());
	}
	
	@Action(id="this",action=ActionEnum.keyReleased)
	public void frameKeyReleased(KeyEvent e) {
		UComm.info(this.getClass(), "[keyReleased] char:",e.getKeyCode());
	}
	
	@Action(id="this",action=ActionEnum.keyPressed)
	public void frameKeyPressed(KeyEvent e) {
		UComm.info(this.getClass(), "[keyPressed] char:",e.getKeyCode());
	}
}
